import * as api from '@/api/request.js';
const actions = {
	set_jdtoken(state, options) {
		context.commit('set_jdtoken')
	},
	setUserInfo(context, options) {
		context.commit('setUserInfo', options)
	},
	// 获取用户信息并更新到 Vuex 中
	async getUserInfo({
		commit,
		state
	}) {
		if (!state.userInfo) {
			// 如果 state 中没有用户信息，从后端获取
			const userInfo = await this.$request.get(`/CatUser/${user.userId}`); // 替换为实际的 API 地址和用户ID
			commit('setUserInfo', userInfo);
		}
	},
	setUser(context, options) {
		context.commit('setUser', options)
	},
	setSpecs: (state, options) => {
		context.commit('setSpecs')
	},
	setSpecsList: (state, options) => {
		context.commit('setSpecslist')
	},
	setStatus: (state, options) => {
		context.commit('setStatus')
	},
	setGoodsid: (state, options) => {
		context.commit('setGoodsid')
	}
}
export default actions